What Is QuickDraw GX?
QuickDraw GX is many things. It is a system extension that adds powerful color graphics and typographic capabilities to your Macintosh. It is a run-time environment that supports these powerful graphics. It is an API (an application programming interface) that your application can use to provide these graphics capabilities to your application's users. It is a printing architecture that provides a new system-wide human interface for printing. It is also a program-
ming and development environment that helps you to create exciting new graphics applications.QuickDraw GX is a large system; it provides many features. The following sections examine these features and then describes how QuickDraw GX fits in with the rest of the Macintosh system software and how your application can use QuickDraw GX.
Features of QuickDraw GX
QuickDraw GX is a vast imaging architecture providing support for a great number of new graphics, typography, and printing features. Here is a list that highlights the features of this system:
As you can see, QuickDraw GX is an extensive new approach to computer graphics. The next two sections describe how QuickDraw GX fits in with the rest of the Macintosh system software and how your application can take advantage of the QuickDraw GX feature set.
- Multiple types of shapes. QuickDraw GX has built-in support for multiple types of graphic and typographic images--called shapes. Examples of shapes include lines, points, rectangles, polygons, curves, multiple-curve paths, simple text, text with multiple styles, sophisticated line layout shapes, color bitmaps, and hierarchical pictures.
- Graphics geometry engine. QuickDraw GX allows you to perform sophisticated geometric operations on the geometric shapes. These operations include editing, measuring, geometric arithmetic, simplifying, and converting from one type of shape to another.
- Resolution independence. With QuickDraw GX, you define your shapes using measurements that are independent of the resolution of any imaging device.
- Stylistic variations. You can set stylistic properties for each shape, including the width of the pen stroke, arbitrary dashes, caps, corner joins, patterns, font, font variations, and typestyle.
- Device-independent colors. QuickDraw GX colors are defined in a device-
independent way and, using a sophisticated color-matching mechanism, can be converted to device-specific colors for any device.- Multiple color spaces. QuickDraw GX provides built-in support for color spaces including luminance (for grayscale), RGB (for monitors), YIQ (for color video broadcast), CMYK (for printing), HSV and HLS (for color picking), and CIE (for colorimetrics).
- Transformations. Using mathematical mappings, QuickDraw GX allows you to relocate, scale, skew, add perspective to, and otherwise distort
any shape.- Viewing architecture. This powerful hierarchical architecture allows for simultaneous views of an shape, with different scales and orientations, on single or multiple devices, with simultaneous updating.
- Simple typography. QuickDraw GX provides an easy-to-use mechanism for creating simple text shapes--that is, text with a single font and typestyle--useful for dialog boxes or other situations where relatively unsophisticated string presentation is required.
- Sophisticated typography. QuickDraw GX also provides for more sophisticated typography, supporting typographic shapes that contain multiple fonts and typestyles. You can also specify justification, alignment, and individual positions and rotations for each character.
- Line layout. The most sophisticated type of typography, line layout allows you to perform kerning, tracking, shifting, ligature formation, contextual glyph substitution, multiple language text handling, and line breaking.
- Extensible printing interface. Your application prints a document using the same mechanism, regardless of the type of printer used. Using a new messaging system, your application can override specific printing functionality.
- Support for desktop printers. With QuickDraw GX, printers are represented by printer icons on the computer desktop. Users can print a document simply by dragging the document icon to the printer icon. Desktop printers support printer sharing and allow for control of individual print queues.
- Customizable printing dialog boxes. In addition to standard print options supported by QuickDraw GX, your application can provide additional controls in the standard printing dialog boxes to give your users even more flexibility over printing jobs.
- Portable digital documents. These documents, also called PDDs and print-and-view documents, can be viewed or printed on any computer that has QuickDraw GX installed, without requiring the original application or fonts used to create the document. If QuickDraw GX is installed, any application can create a PDD.
- Printing extensions. A printing extension is like a system extension that provides a specific printing feature. For example, you could create a printing extension to print the word Confidential on the background of every page of a printing job. You can create and provide printing extensions to be used by any application with any printer.
- Supporting system-level software. To support all of the above features, QuickDraw GX provides some new system-level software. For example, there is a new memory architecture (which works in addition to the existing Macintosh Memory Manager), a new messaging system (for printing-related messages), and a collection-managing system (which provides low-
overhead, variable-sized, memory-based data structures).- Consistent programming interface. Although QuickDraw GX is not object-
oriented, it is based on object data structures. QuickDraw GX provides a full range of consistently named functions to operate on these objects.- Programming tools and utilities. In addition to the system-level software, such as messages and collections, QuickDraw GX provides other program-
ming tools and utilities. These include a full set of sample libraries, which use QuickDraw GX to implement some common graphics programming functions (such as drawing conic sections or using offscreen bitmaps). With the libraries, you have access to the actual code used to implement the functions.- Debugging tools and utilities. QuickDraw GX also provides programming tools you can use while debugging, such as sophisticated type checking and an object debugger called GraphicsBug.
- Documentation. For a complete explanation of how to use the myriad features in this list, Apple Computer has created a suite of Inside Macintosh books that cover the QuickDraw GX environment, the object-based architecture, the graphics, typography, and printing features, and the creation of printing extensions and printer drivers.
QuickDraw GX and the Macintosh Toolbox
QuickDraw GX is a system extension that adds new software-based function-
ality to your Macintosh computer system. In general, QuickDraw GX does not replace existing parts of the Macintosh Toolbox; instead, it provides an additional set of features.First of all, QuickDraw GX does not replace the original QuickDraw architec-
ture. QuickDraw provides a set of graphics capabilities using a state-based implementation. QuickDraw GX provides a different set of graphics capabili-
ties using an object-based implementation. An application is free to use both QuickDraw and QuickDraw GX graphics features. QuickDraw GX even provides a mechanism to translate QuickDraw function calls and PICT files into QuickDraw GX graphics objects. An application that does not use QuickDraw GX is unaffected if QuickDraw GX is installed.On the other hand, the QuickDraw GX printing architecture does replace the Printing Manager. (However, applications that are unaware of QuickDraw GX can still call Printing Manager functions; when the application makes a Printing Manager function call, QuickDraw GX translates it into QuickDraw GX printing function calls.) Also, the QuickDraw GX printer driver model replaces the model used by the Printing Manager; therefore, Printing Manager print drivers do not work with QuickDraw GX.
To support the memory demands of an object-based architecture, QuickDraw GX provides a new memory management architecture. This
new system does not replace the Macintosh Memory Manager, but instead works independently of it. An application can create and manipulate QuickDraw GX objects, which the QuickDraw GX system manages, as
well as pointers and Macintosh handles, which the Macintosh Memory Manager manages.QuickDraw GX works in conjunction with other parts of the Macintosh Toolbox. For example, QuickDraw GX provides functions that allow you to associate graphics shapes with specific Macintosh Window Manager windows. When you draw the graphics shapes, QuickDraw GX renders them in the correct position in the correct window on the correct device.
QuickDraw GX and Your Application
Your application can provide one of four different levels of QuickDraw GX support:
QuickDraw GX-unaware applications should be fully compatible with systems running QuickDraw GX. Only applications that rely on unsupported program-
- QuickDraw GX-unaware. This, the lowest level of support, applies to applications that make no explicit use of QuickDraw GX. Applications built before the release of QuickDraw GX fall into this category. Even these applications gain some benefit from QuickDraw GX. For example, when running on a QuickDraw GX system, these applications can create portable digital documents.
- QuickDraw GX-aware. This level of support applies to applications
that implement a core set of QuickDraw GX printing features and that
can import and export QuickDraw GX graphics through the clipboard,
but don't take additional advantage of QuickDraw GX graphics or typography features. A QuickDraw GX-aware application should retain
full compatibility with documents created with earlier versions of the application.- QuickDraw GX-savvy. This level of support applies to applications that implement full support for QuickDraw GX graphics, typography, and printing features. A QuickDraw GX-savvy application should also retain full compatibility with documents created with earlier versions of the application.
- QuickDraw GX-dependent. These applications require QuickDraw GX graphics, typography, or printing to function properly. These applications work only on systems that have QuickDraw GX available.
ming methods are incompatible with QuickDraw GX systems. If your applica-
tion relies on such methods, you should seriously consider releasing a version compatible with QuickDraw GX, or, better yet, a QuickDraw GX-aware or QuickDraw GX-savvy version!Chapter 8, "Printing," discusses some of the requirements for QuickDraw GX-
aware applications. That chapter presents some programming examples you can use when converting an existing application into an application that is QuickDraw GX-aware.To become QuickDraw GX-savvy, your application must implement additional features, including supporting multiple page formats during printing and exporting QuickDraw GX graphics into QuickDraw PICT files when communi-
cating with applications that are not QuickDraw GX-aware. These applications must also follow a set of programming guidelines, which are provided with
the QuickDraw GX Software Development Kit and which include using QuickDraw GX for hit-testing, using line layout for typographic processing, and using QuickDraw GX bitmaps for color ramps.